<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Admin\Model;
use Think\Model;
class ProductLeanCloudModel extends SyncModel{
    
    protected $tableName="product";


    //leancloud表名
    protected $leancloudName = "Product";
    
   protected $_validate = array(
     array('name','require','商品名称必须填写'),  
     array('intro','require','商品简介必须填写'), 
     array('picarry','require','商品橱窗图片必须上传'),
     array('content ','require','商品详细描述必须填写'), 
   );
   
   //映射的字段
   protected $_map = array('objectId' => 'id','createdAt'=>'createdate', 'updatedAt'=>'lastupdate'); 
   
    //leancloud 字段类型
    protected $leancloudelds = array(
        "objectId"=>"String",
        "name"=>"String",
        "picarry"=>"String",
        "picurlarray"=>"String",
        "cid"=>"Number",
        "intro"=>"String",
        "content"=>"String",
        "isNice"=>"Number",
        "createdAt"=>"Date",
        "updatedAt"=>"Date",
        'syncStatus'=>"Number"
    );
   
    //配置字段
    protected $fields = array(
        'objectId', 
        'name', 
        'picarry',
        'picurlarray',
        'cid',
        'intro', 
        'content',
        'isNice',
        'createdAt', 
        'updatedAt', 
        'syncStatus', 
        'status',
        '_type'=>array(
            'objectId'=>'int', 
            'name'=>'varchar', 
            'picarry'=>'varchar',
             'picurlarray'=>'varchar',
            'cid'=>'int',
            'intro'=>'varchar',
            'content'=>'varchar',
            'isNice'=>'int',
            'createdAt'=>'int',
            'updatedAt'=>'int',
            'syncStatus'=>'int',
            'status'=>'int'
        )
    );
    
}
